import time

from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.implicitly_wait(10)
driver.maximize_window()
#删除固资台账数据
def delete():
    # 打开固资地址
    driver.get('http://10.10.10.120:30202')
    #输入用户名密码
    driver.find_element(By.ID,'username').send_keys('administrator')
    driver.find_element(By.ID,'password').send_keys('Gdjt@2021')
    driver.find_element(By.XPATH, '//button').click()
    #进入固定资产台账
    driver.find_element(By.XPATH, '//*[text()="资产信息管理"]').click()
    driver.find_element(By.XPATH, '//*[text()="固定资产台账"]').click()
    driver.find_element(By.XPATH, '//*[text()="操作"]/.').click()
    time.sleep(3)
    #删除
    driver.find_element(By.XPATH, '//*[text()="删除"]/.').click()
    driver.find_element(By.XPATH, '//*[text()="确 定"]/.').click()

if __name__ == '__main__':
    delete()
    time.sleep(5)